package com.cjm.one.model.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.util.Date;

import com.cjm.one.model.base.BaseEntity;
import lombok.Data;

/**
 * 资源表
 * @TableName sys_resource
 */
@TableName(value ="sys_resource")
@Data
public class SysResource extends BaseEntity  {
    /**
     * 主键id
     */


    /**
     * 父级id
     */
    private Long parentId;

    /**
     * 父级ids
     */
    private String parentIds;

    /**
     * 标题（目录名称、菜单名称、按钮名称）
     */
    private String title;

    /**
     * 类型（1、目录；2、菜单；3、按钮）
     */
    private String type;

    /**
     * 权限标识（菜单和按钮）
     */
    private String permission;

    /**
     * 路由地址（目录和菜单）
     */
    private String routePath;

    /**
     * 菜单组件名称
     */
    private String componentName;

    /**
     * 菜单组件地址
     */
    private String componentPath;

    /**
     * 状态（0、正常；1、禁用）
     */
    private String resStatus;

    /**
     * 排序
     */
    private BigDecimal resSort;

    /**
     * 外链菜单（1：是；2：否）
     */
    private String menuExtFlag;

    /**
     * 菜单缓存（1：是；2：否）
     */
    private String menuCacheFlag;

    /**
     * 菜单和目录可见（1：是；2：否）
     */
    private String menuHiddenFlag;

    /**
     * 菜单图标
     */
    private String menuIcon;



    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysResource other = (SysResource) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
            && (this.getParentIds() == null ? other.getParentIds() == null : this.getParentIds().equals(other.getParentIds()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getPermission() == null ? other.getPermission() == null : this.getPermission().equals(other.getPermission()))
            && (this.getRoutePath() == null ? other.getRoutePath() == null : this.getRoutePath().equals(other.getRoutePath()))
            && (this.getComponentName() == null ? other.getComponentName() == null : this.getComponentName().equals(other.getComponentName()))
            && (this.getComponentPath() == null ? other.getComponentPath() == null : this.getComponentPath().equals(other.getComponentPath()))
            && (this.getResStatus() == null ? other.getResStatus() == null : this.getResStatus().equals(other.getResStatus()))
            && (this.getResSort() == null ? other.getResSort() == null : this.getResSort().equals(other.getResSort()))
            && (this.getMenuExtFlag() == null ? other.getMenuExtFlag() == null : this.getMenuExtFlag().equals(other.getMenuExtFlag()))
            && (this.getMenuCacheFlag() == null ? other.getMenuCacheFlag() == null : this.getMenuCacheFlag().equals(other.getMenuCacheFlag()))
            && (this.getMenuHiddenFlag() == null ? other.getMenuHiddenFlag() == null : this.getMenuHiddenFlag().equals(other.getMenuHiddenFlag()))
            && (this.getMenuIcon() == null ? other.getMenuIcon() == null : this.getMenuIcon().equals(other.getMenuIcon()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
        result = prime * result + ((getParentIds() == null) ? 0 : getParentIds().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getPermission() == null) ? 0 : getPermission().hashCode());
        result = prime * result + ((getRoutePath() == null) ? 0 : getRoutePath().hashCode());
        result = prime * result + ((getComponentName() == null) ? 0 : getComponentName().hashCode());
        result = prime * result + ((getComponentPath() == null) ? 0 : getComponentPath().hashCode());
        result = prime * result + ((getResStatus() == null) ? 0 : getResStatus().hashCode());
        result = prime * result + ((getResSort() == null) ? 0 : getResSort().hashCode());
        result = prime * result + ((getMenuExtFlag() == null) ? 0 : getMenuExtFlag().hashCode());
        result = prime * result + ((getMenuCacheFlag() == null) ? 0 : getMenuCacheFlag().hashCode());
        result = prime * result + ((getMenuHiddenFlag() == null) ? 0 : getMenuHiddenFlag().hashCode());
        result = prime * result + ((getMenuIcon() == null) ? 0 : getMenuIcon().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(this.getId());
        sb.append(", parentId=").append(parentId);
        sb.append(", parentIds=").append(parentIds);
        sb.append(", title=").append(title);
        sb.append(", type=").append(type);
        sb.append(", permission=").append(permission);
        sb.append(", routePath=").append(routePath);
        sb.append(", componentName=").append(componentName);
        sb.append(", componentPath=").append(componentPath);
        sb.append(", resStatus=").append(resStatus);
        sb.append(", resSort=").append(resSort);
        sb.append(", menuExtFlag=").append(menuExtFlag);
        sb.append(", menuCacheFlag=").append(menuCacheFlag);
        sb.append(", menuHiddenFlag=").append(menuHiddenFlag);
        sb.append(", menuIcon=").append(menuIcon);
        sb.append(", createDate=").append(super.getCreateTime());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}